<%--
  Created by IntelliJ IDEA.
  User: 董春光
  Date: 2020-08-05
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>查询</title>
    <script src="js/jquery-3.5.1.js"></script>
    <script>
        $(function () {
            function del(id) {
                var flag=confirm("是否删除");
                if(flag){
                 location.href="delbyid?comId"+id;
                }
            }
        });
    </script>
</head>
<body>
<form action="selectall" method="post">
    <input type="text" name="comName">
    <input type="submit" value="查询">
    <a href="addall"><input type="button" value="添加"></a>
</form>

<table border="1">
    <tr>
        <td>
            商品ID
        </td>
        <td>
            商品名称
        </td>
        <td>
            商品数量
        </td>
        <td>
            商品单位
        </td>
        <td>
            操作
        </td>
    </tr>
    <c:forEach var="p" items="${list}">
    <tr>
        <td>
                ${p.comId}
        </td>
        <td>
                ${p.comName}
        </td>
        <td>
                ${p.comInventory}
        </td>
        <td>
                ${p.comUnit}
        </td>
        <td>
            <a href="javascript:void(0)" onclick="del(${p.comId})">删除</a><a>修改</a>
        </td>
    </tr>
    </c:forEach>
</table>
</body>
</html>
